<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <label v-for="item in originHobbies" :key="item">
    <!-- :id 动态绑定id-->
    <input type="checkbox" :value="item" :id="item" v-model="likes">{{item}}
  </label>
  <h2>您的爱好是: {{likes}}</h2>
</div>



<script src="../js/vue.js"></script>
<script>
  // 1.创建Vue的实例对象
  const app = Vue.createApp({
    data(){
      return {
        originHobbies: ['篮球', '足球', '乒乓球', '羽毛球', '台球', '高尔夫球'],
        likes: []
      }
    }
  }).mount('#app');
</script>
</body>
</html>